<?php
/**
 * Created by PhpStorm.
 * User: dell
 * Date: 2017/7/5
 * Time: 16:38
 */
namespace app\admin\validate;
use think\Validate;

class AssessmentCycle extends Validate
{
    protected $rule =   [
        'name'  => 'require|max:25|unique:assessment_cycle',
    ];

    protected $message  =   [
        'name.require' => '名称必须',
        'name.max'     => '名称最多不能超过25个字符',
        'name.unique'  =>'名称已存在',
    ];

    //验证场景
    protected $scene = [
        'edit'  =>  ['name'=>'require|max:25'],
    ];

}